From 0c4796126a4f13ff157822411aa6586f7d1a92f9 Mon Sep 17 00:00:00 2001 From: "mjw@wray-m-3.hpl.hp.com" Date: Fri, 24 Sep 2004 13:42:42 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.171 (41542452bRfDdWxp_J3LdHeEUSX1Nw) Add a flag to control daemonizing xend as it seems it might be causing some problems. --- tools/python/xen/xend/server/SrvDaemon.py | 24 ++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/tools/python/xen/xend/server/SrvDaemon.py b/tools/python/xen/xend/server/SrvDaemon.py index 5590df7b65..f3f72b3dd4 100644 --- a/tools/python/xen/xend/server/SrvDaemon.py +++ b/tools/python/xen/xend/server/SrvDaemon.py @@ -42,6 +42,7 @@ import console import domain from params import * +DAEMONIZE = 1 DEBUG = 1 class NotifierProtocol(protocol.Protocol): @@ -464,16 +465,9 @@ class Daemon: else: # Child os.execl("/usr/sbin/xfrd", "xfrd") - - def start(self, trace=0): - """Attempts to start the daemons. - The return value is defined by the LSB: - 0 Success - 4 Insufficient privileges - """ - xend_pid = self.cleanup_xend() - xfrd_pid = self.cleanup_xfrd() + def daemonize(self): + if not DAEMONIZE: return # Detach from TTY. os.setsid() @@ -492,7 +486,19 @@ class Daemon: os.open('/dev/null', os.O_RDWR) os.dup(0) os.dup(1) + + def start(self, trace=0): + """Attempts to start the daemons. + The return value is defined by the LSB: + 0 Success + 4 Insufficient privileges + """ + xend_pid = self.cleanup_xend() + xfrd_pid = self.cleanup_xfrd() + + self.daemonize() + if self.set_user(): return 4 os.chdir("/") -- 2.30.2